import request from '@/until/request'
import Vue from 'vue';




// 登录方法
export function login (userName, passWord,validCode) {
  const data = {
    userName,
    passWord,
    validCode
  }
  return request({
    url: `${Vue.prototype.$configURL}user/userLogin`,
    method: 'post',
    data: data,
    headers: {
      isToken: false,
      repeatSubmit: false
    }
  })
}

// 路由获取
export const getRouters = () => {
  return request({
    url: `${Vue.prototype.$configURL}user/route`,
    method: 'get',
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 退出登录
export const userLogOut = () => {
  return request({
    url: `${Vue.prototype.$configURL}user/logOut`,
    method: 'get',
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 获取验证码
export const smsLoginValidCode = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}sms/loginValidCode`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}


// 发送刷新key验证码
export const smsRefreshKey = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}sms/refreshKey`,
    method: 'get',
    // params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 拨打电话
export const customersSendPhone = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}customers/sendPhone`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}


// 公司状态
export const userSetComStatus = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}user/setComStatus`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 修改密码 
export const userUpdatePwd = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}user/updatePwd`,
    method: 'post',
    data: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
// 
